<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="pl">  
    <head>
        <jsp:include page="./../util/configurationPage.jsp"/>
        <style type="text/css">
            #inner {
                display: table;
                margin: 0 auto;
            }
            #activeEx {
                background-color : #5CB85C;
                color:#ffffff;
                border: 1px;
            }
            .input-xs {
                width: 50px;
                height: 30px
            }
            .row-padding {
                padding-top: 5px;
            }
            .breadcrumb>li+li:before {color: rgba(0, 0, 0, 1); content: "\232A\00a0";}
        </style>
        <script type="text/javascript">
            $(window).on('load', function() {

                $('.selectpicker').selectpicker();

                // $('.selectpicker').selectpicker('hide');
            });
        </script>
    </head>
    <body>
        <jsp:include page="./../navbar/navbarMain.jsp"/>
        <br>

        <div class="container ">
            <div class="col-lg-12">
                <div class="row">
                    <div class="col-lg-3">
                        <jsp:include page="./../navbar/menuBar.jsp"/>
                    </div>
                    <div class="col-lg-9">
                        <div class="panel panel-success">

                            <div class="panel-heading">
                                <h3 class="panel-title">Koszyk</h3>
                            </div>
                            <ol class="breadcrumb">
                                <li>1. Zawartość koszyka</li>
                                <li class="active">2. Odbiorca</li>
                                <li class="active">3. Podsumowanie</li>
                                <li class="active">4. Potwierdzenie</li>
                            </ol>
                            <div class="panel-body">


   <c:if test="${commandBean.orderCounter eq 0.0}">
                                            
                                           <div class="alert alert-info">Koszyk jest pusty.</div>
                                            
                                        </c:if>
                                        <c:if test="${commandBean.orderCounter ne 0.0}">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Produkt</th>
                                            <th>Cena</th>
                                            <th>Ilość</th>
                                            <th>Wartość</th>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        
                                      
                                        <c:forEach items="${itemList}" var="item">                                                                                                      
                                            <tr>
                                                <td>
                                                    ${item.number}   
                                                </td>
                                                <td>  
                                                    ${item.productName}  
                                                </td>
                                                <td>
                                                    ${item.price} zł  
                                                </td>
                                                <td> 
                                                    ${item.orderedQuantity}                                 
                                                </td>
                                                <td>
                                                    ${item.displayedPriceForAll} zł  
                                                </td> 
                                                <td>
                                                    <div class="pull-right">
                                                        <a href="cart.htm?step=1&delete=${item.orderId}" class="btn btn-xs btn-danger ">Usuń</a>
                                                </td>
                                            </tr>
                                        </c:forEach>
                                        <tr>
                                            <td>
                                                Suma: 
                                            </td>
                                            <td></td><td></td><td></td>
                                            <td>
                                                ${sum} zł
                                            </td> 
                                            <td></td>
                                        </tr>
                                      
                                    </tbody>
                                </table>
  </c:if>

                                <ul class="pager" >
                                    <li><a class="active" href="list.htm?page=1"> Powrót do zakupów</a></li>
                                    <c:if test="${commandBean.orderCounter ne 0.0}">
                                    <li><a href="cart.htm?step=2">Odbiorca &rarr;</a></li>
                                    </c:if>
                                </ul>

                            </div>
                        </div>
                    </div>
                </div>  
            </div>
        </div>


        <jsp:include page="./../util/footer.jsp"/>
    </body>
</html>

